package com.movie.ticketing.orderservice.service;

import com.movie.ticketing.orderservice.entity.Order;
import com.movie.ticketing.orderservice.repository.OrderRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderService {
    @Autowired
    private OrderRepository orderRepository;

    public List<Order> getAllOrders() {
        return orderRepository.getAllOrders();
    }

    public Order getOrderById(Long id) {
        return orderRepository.getOrderById(id);
    }

    public Order saveOrder(Order order) {
        return orderRepository.saveOrder(order);
    }

    public Order updateOrder(Long id, Order orderDetails) {
        return orderRepository.updateOrder(id, orderDetails);
    }

    public void deleteOrder(Long id) {
        orderRepository.deleteOrder(id);
    }
}